CentOS 6
Sponsored Link

LDAP over TLS
2015/03/17
 
Configure LDAP over TLS to make connection be secure.
[1]
[2] Configure LDAP Server.
[root@dlp ~]#
cp /etc/pki/tls/certs/server.key \
/etc/pki/tls/certs/server.crt \
/etc/pki/tls/certs/ca-bundle.crt \
/etc/openldap/certs/

[root@dlp ~]#
chown ldap. /etc/openldap/certs/server.key \
/etc/openldap/certs/server.crt \
/etc/openldap/certs/ca-bundle.crt
[root@dlp ~]#
vi mod_ssl.ldif
# create new

dn: cn=config
changetype: modify
add: olcTLSCACertificateFile
olcTLSCACertificateFile: /etc/openldap/certs/ca-bundle.crt
-
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/openldap/certs/server.crt
-
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/openldap/certs/server.key

[root@dlp ~]#
ldapmodify -Y EXTERNAL -H ldapi:/// -f mod_ssl.ldif

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"

[root@dlp ~]#
vi /etc/sysconfig/ldap
# line 16: change

SLAPD_LDAPS=
yes
[root@dlp ~]#
/etc/rc.d/init.d/slapd restart

Stopping slapd:                    [  OK  ]
Starting slapd:                    [  OK  ]
[3] Configure LDAP Client for TLS connection.
[root@www ~]#
echo "TLS_REQCERT allow" >> /etc/openldap/ldap.conf

[root@www ~]#
echo "tls_reqcert allow" >> /etc/nslcd.conf

[root@www ~]#
echo "tls_reqcert allow" >> /etc/pam_ldap.conf
[root@www ~]#
authconfig --enableldaptls --update

[root@www ~]#
logout
CentOS release 6.8 (Final)
Kernel 2.6.32-642.3.1.el6.x86_64 on an x86_64
www.srv.world login:
redhat

Password:
Last login: Wed Mar 17 04:42:32 on ttyS0
[redhat@www ~]$    
# just logined
 
Tweet